<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>构造函数constructor</title>
	</head>
	<body>
		<script type="text/javascript">
			class Mobile{
				constructor(brand,color,cpu){
					this.brand = brand;
					this.color = color;
					this.cpu = cpu;
				}
				called(){
					console.log('打电话...');
				}
				playGame(){
					console.log('打游戏...');
				}
				music(){
					console.log('听歌...');
				}
			}
			var m = new Mobile('华为','森林绿','麒麟980');
			m.music();
		</script>
	</body>
</html>